#!/bin/bash

set -e

SERVER_CONF_DIR="/etc/clickhouse-server"

\cp -rfv "$(dirname $0)/." $SERVER_CONF_DIR

if chown clickhouse:clickhouse -R /etc/clickhouse-server/certs; then
    echo "Ownership of /etc/clickhouse-server/certs changed successfully."
else
    echo "Failed to change ownership of /etc/clickhouse-server/certs."
fi

/entrypoint.sh
